package com.ftg.learn.day09.pattern.prototype;

/**
 * @author 布衣
 */
public class LionPrototype {

    private Lion l1 = new Lion("辛巴");

    public Lion getLionInstance() {
        try{
            return (Lion) l1.clone();
        } catch (CloneNotSupportedException e) {
            System.out.println("你的代码有错误了");
        }
        return null;
    }

    public static void main(String[] args) {
        LionPrototype l = new LionPrototype();
        Lion lionInstance = l.getLionInstance();
        Lion lionInstance1 = l.getLionInstance();
        Lion lionInstance2 = l.getLionInstance();
        Lion lionInstance3 = l.getLionInstance();

    }

}
